package com.tarena.lbs.business.dao.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tarena.lbs.business.dao.mapper.StoreChainMapper;
import com.tarena.lbs.business.dao.repository.storeChainRepository;
import com.tarena.lbs.business.pojo.po.StoreChainPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class StoreChainRepositoryImpl implements storeChainRepository {
    @Autowired
    private StoreChainMapper storeChainMapper;
    @Override
    public void save(StoreChainPO storeChainPO) {
        // 保存门店链
        storeChainMapper.insert(storeChainPO);
    }

    @Override
    public StoreChainPO getByStoreId(Integer id) {
        QueryWrapper<StoreChainPO> queryWrapper = new QueryWrapper<StoreChainPO>();
        queryWrapper.eq("store_id", id);
        return storeChainMapper.selectOne(queryWrapper);
    }
}
